import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    children: [
      {
        path: '/detail',
        name: 'Detail',
        component: () => import('@/components/Detail.vue')
      },
      {
        path: '/share',
        name: 'Share',
        component: () => import('@/components/Share.vue')
      },
      {
        path: '/serum',
        name: 'Serum',
        component: () => import('@/components/Serum.vue')
      },
      {
        path: '/essay',
        name: 'Essay',
        component: () => import('@/components/Essay.vue')
      },
      {
        path: '/job',
        name: 'Job',
        component: () => import('@/components/Job.vue')
      },
      {
        path: '/test',
        name: 'Test',
        component: () => import('@/components/Test.vue')
      }
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
